<template>
  <div class="page">
    <m-header title="我的团队" :canback="Boolean(1)"></m-header>
    <section class="body">
      <div style="text-align:right;">
        <span>总人数：</span>
        <span>{{list&&list.team_num}}</span>
      </div>
      <ul class="list">
        <router-link
          class="item"
          :to="{name:'TeamList',query:{type:item.type}}"
          v-for="(item,index) in listArr"
          :key="index"
        >
          <span>{{item.name}}</span>
          <i class="iconfont iconright"></i>
        </router-link>
      </ul>
    </section>
  </div>
</template>
<script>
import { Owner } from '@/server/server.js';
import { mapGetters } from 'vuex';
import { Secret } from '@/assets/commonjs/utils.js';

export default {
  name: "PayInfo",
  data() {
    return {
      listArr: [
        {
          name: '我的直推',
          type: 'zt'
        },
        {
          name: '我的间推',
          type: 'jt'
        },
      ],
      list:null
    }
  },
  created(){
    this.getTeam(this.uid);
  },
  computed: {
    ...mapGetters(['uid'])
  },
  methods:{
    /**
     * 团队信息
     */
    getTeam(uid) {
      Owner.getTeam({ uid }).then(res => {
        if (res.code == 1) {
          this.list = JSON.parse(Secret.decrypt(res.data));
        } else {
          mui.toast(res.msg);
          return;
        }
      })
    },
  }

}
</script>
<style lang="less" scoped>
@import "~link-less";
.body {
  // background-color: @bg-color;
  padding: @padding-primary;
  color: white;
  .list {
      padding: @padding-primary;
      background-color: @bg-card-color;
      border-radius: 30px;
      box-sizing: border-box;
    .item {
        border-bottom: 1px solid #eee;
      .display-flex();
      justify-content: space-between;
      align-items: center;
      padding: @padding-primary 0;
      // border-bottom: 1px solid #ddd;
    }
  }
}
</style>
